Skip to content

Conversation

thecoop
Copy link
Member

@thecoop thecoop commented Sep 30, 2024

Contrary to what you might think, this is actually maintaining existing behaviour when run on JDK 22 and 23. IsoCalendarDataProvider overrides the root locale weekyear to use ISO, which effectively means we are already using ISO for all week-based date formats. Changing to JDK 23 means the locale-based ones use Sunday/1-day for weekfield definitions, so setting this to explicitly ISO is maintaining the existing behaviour. It also makes all week-date formats definitely use ISO definitions.

This is aimed at 8.x, as that's where all the docs are targetting. When we're all settled on the various PRs, I'll forward-port this to main, along with any relevant locale docs already merged into 8.x

@thecoop thecoop added :Core/Infra/Core Core issues without another label >refactoring v8.16.0 labels Sep 30, 2024
Copy link
Contributor

Documentation preview:

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Sep 30, 2024
@thecoop thecoop requested a review from a team September 30, 2024 11:33
// fill the rest of the date up with the parsed date
if (accessor.isSupported(ChronoField.YEAR) == false
&& accessor.isSupported(ChronoField.YEAR_OF_ERA) == false
&& accessor.isSupported(WeekFields.ISO.weekBasedYear()) == false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These additions, and similar, are because ISO.weekBasedYear is a different thing to of(locale).weekBasedYear, even though they probably represent the same thing

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thecoop thecoop merged commit a5c05af into elastic:8.x Oct 1, 2024
14 checks passed
@thecoop thecoop deleted the iso-weekfields branch October 1, 2024 13:10
thecoop added a commit to thecoop/elasticsearch that referenced this pull request Oct 1, 2024
…stic#113787)

This is so it doesn't change when changing JDK version and locale database
thecoop added a commit to thecoop/elasticsearch that referenced this pull request Oct 1, 2024
…stic#113787)

This is so it doesn't change when changing JDK version and locale database
thecoop added a commit that referenced this pull request Oct 2, 2024
Forward-port changes from #113787, and update the docs with similar information to #113587
gmarouli pushed a commit to gmarouli/elasticsearch that referenced this pull request Oct 3, 2024
…stic#113870)

Forward-port changes from elastic#113787, and update the docs with similar information to elastic#113587
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 4, 2024
…stic#113870)

Forward-port changes from elastic#113787, and update the docs with similar information to elastic#113587
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants